Visual Basic program "VB2019 Checkers" - Description and operation

Introduction and Purpose

The final purpose of this program is to play checkers which uses some form of Articial Intelligence or AI. AI meaning that the program should learn from the previous games played. Learned means that the results (the numbers of winning games) should improve.
However there is more: the program "VB2019 Checkers" is not finished as 6 January 2024:
  1. It contains certain errors.
  2. Certain internal checks are missing.
  3. And most important it does not including any learning capabilities.
What that means that the program should me improved by implementing a communication tool. This communication tool can be set of lines of comments. This comments should be used to modify the Visual Basic Program.
It is understood that this is not easy.
What this requires is that the program should be improved with the capability to write Visual Basic text lines.
As a result at the beginning of the program the following steps should be performed:
  1. Read the current source of the program "VB2019 Checkers"
  2. Read one command line.
  3. Modify the program as requested
  4. Contine with item #2 until all commands are finished.
  5. Create an executable.
To get the executable of this program select this link: VB2019 Checkers.zip

Program VB2019 Checkers Description and Operation.

The program VB2019 Checkers uses two forms: a "Control Form" and a "Test Form"
  1. The "Control Form" is used to a game of checkers by both players
  2. The "Test Form" is used as an example to test one game.

Control Form

The Control Form shows: 2 buttons "Start" en "End", a checkerboard, one message, and 2 labels: player and state.
  • When "Start" is selected the button changes to "Reset"
  • When "Reset" is selected the game is cleared. The Button Changes to "Start"
  • When "End" is selected the program terminates.
The display shows a checkerboard of 4x10. There are 5 white pieces and 5 black pieces.

There is only one message: Wrong Piece.
This message is displayed when player 1 tries to move a black piece or player 2 tries to move a white piece

The variabele player can have two values: 1 or 2, to indicate the player which has to perform a move.
When player is 1 the background is white. When player is 2 the background is black.

Picture 1

Test Form

The "Test Form" consists of 2 parts:
  • The top part, shows of checkerboard layout
  • The bottom part, shows the moves of the test match.
The checkerboard layout contains 10x4 squares.
The bottom line is marked from 1 to 5 and shows the 5 white pieces
The top line is marked from 16 to 20 and shows the 5 black pieces
The two horizontal lines in the middle are marked from 6 to 10 and from 11 to 15. These squares are currently empty.

The bottom part shows 6 moves by white and 6 moves by black, line by line. Each move consists normally of 2 numbers incating the from and the to field. Sometimes there are three fields when a piece can jump again.

Picture 2
  1. The first move by white contains of the two numbers 1, 6. That means player 1, white, has to select the squares 1 and 6.
    Square 1 is the from selection. When square 1 is selected it shows a black O.
    Square 6 is the to selection. When square 6 is selected, square 1 is cleared, square 6 becomes white and shows a black O.
    After the move the variabele player becomes 2.
  2. The first move by black contains of the two numbers 16, 11. That means player 2, black, has to select the squares 16 and 11. When square 16 is selected it shows a white O. When square 11 is selected, square 16 is cleared and square 11 becomes black shows a white O.
  3. The second move by white contains of the two squares 2, 7. The second move by black involves the three numbers 11, 2 and 13 and two white pieces are captured.
  4. The third move by white contains of the two numbers 3, 8. That means player 1, white, has to select the squares 3 and 8. When square 3 is selected it should show a black O, but that is not the case. When square 8 is selected, square 3 is not cleared and square 8 does not show a black O. This means the move is not performed.
    What is also important that the variable "player" is not changed from 1 into 2.
    This defines comment #1
There are also certain error conditions. Consider the next two moves:
  1. The first move by white contains of the two numbers 1, 12. That means player 1, white, has to select the squares 1 and 12.
    Square 1 is the from selection. When square 1 is selected it shows a black O.
    Square 12 is the to selection. When square 12 is selected, square 1 is cleared, square 12 becomes white and shows a black O.
    After the move the variabele player becomes 2.
    How ever this is unlegal move!
  2. The first move by black contains of the two numbers 17, 1. That means player 2, black, has to select the squares 17 and 1. When square 17 is selected it shows a white O. When square 1 is selected, square 12 is cleared and square 1 becomes black shows a white O.
    How ever this is also unlegal move!
    Square 17 is not cleared. This is also un error. However?
The lesson is that both moves should be prevented. That should be explained in comment #2 and comment #3.
See also Reflection #1.


Reflection 1.


Feedback

None


Created: 5 January 2024

Back to my home page Index